package org.whh;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.whh.auth.interceptor.AuthInterceptor;

@SpringBootApplication
@MapperScan("org.whh.*.mapper")
@ServletComponentScan("org.whh.auth.listener")
public class AppStart implements WebMvcConfigurer {
    @Autowired
    AuthInterceptor authInterceptor;

//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//
//        registry.addInterceptor(authInterceptor)
//                .excludePathPatterns("/login","/logout");
//
//    }

    public static void main(String[] args) {
        SpringApplication.run(AppStart.class,args);
    }
}
